package cn.git.controller;

import cn.git.dto.ParamDTO;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/**
 * @description: 测试controller
 * @program: bank-credit-sy
 * @author: lixuchun
 * @create: 2024-07-10
 */
@RequestMapping("/some")
@RestController
@Slf4j
public class SomeController {

    @GetMapping("/test")
    public String someHandle() {
        System.out.println("================Docker file test==============");
        log.info("================Docker file test==============".concat(StrUtil.toString(System.currentTimeMillis())));
        return "hello world --> release 2.0";
    }


    @GetMapping("/test/header")
    public String someHandle(@RequestHeader(value = "X_Token") String token) {
        return "hello token".concat(token);
    }

    @PostMapping("/param")
    public String param(ParamDTO paramDTO) {
        return JSONObject.toJSONString(paramDTO);
    }

}
